<?php 
define("__ACTIVE_PAGE__", "message");
require_once dirname(__FILE__).'/init.php'; 

if ($_GET["id"]){
	$message = new CompanyMessages($_GET["id"]);
	if ($company->id != $message->companyId){
		header('location: index.php');
		die();
	}
}

?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<?php require dirname(__FILE__).'/common/head.php'; ?>
	</head>
	<body>
		<?php require dirname(__FILE__).'/common/header.php'; ?>
		<div class="container">
			<div class="row">
				<div class="span12">
					<h4>Message</h4>
					<div class="row">
						<div class="span2">
							<p>Send <?php echo $message->count ?>/<?php echo $message->amount ?> messages</p>
						</div>
						<div class="span6">
							<div class="progress progress-success">
								<div class="bar" style="width: <?php echo round($message->count*100/$message->amount); ?>%"></div>
							</div>
						</div>
						<div class="span2">
							<p><?php echo round($message->count*100/$message->amount); ?>%</p>
						</div>
					</div>
					<div class="well">
						<h2><?php echo $message->title; ?></h2>
						<p><?php echo nl2br($message->text); ?></p>
					</div>
				</div>
			</div>
			<?php require dirname(__FILE__).'/common/footer.php'; ?>
		</div> 
	</body>
</html>

